package org.csu.onlineedubackend.dto;

import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * DTO for detailed course information including chapters
 */
@Data
public class CourseDetailDTO {
    private Long id;
    private String title;
    private String description;
    private String coverImage;
    private BigDecimal price;
    private String teacherName;
    private String teacherAvatar;
    private String teacherTitle;
    private String teacherDescription;
    private Integer teacherId;       // 教师ID
    private String category;        // 课程类别
    private String level;           // 课程难度级别
    private Integer totalDuration; // Total duration in minutes
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    private List<ChapterDTO> chapters;
    private Double averageRating;
    private Integer totalComments;
    private Integer totalStudents;  // 也就是订阅数
    private Boolean isBookmarked;
    private Boolean isPurchased;
    private double courseProcess;  // 课程进度
    
    /**
     * Nested DTO for chapter information
     */
    @Data
    public static class ChapterDTO {
        private Long id;
        private String title;
        private String description;
        private Integer sequence;
        private String videoUrl;
        private Integer duration;
        private Boolean isPreviewable; // 是否可以试看
    }
}